﻿namespace Resonator.Web.Controllers
{
	using System.IO;
	using Castle.ActiveRecord;
	using Castle.MonoRail.Framework;

	public class AdminController : ResonatorController
	{
		public void Index()
		{
		}

		[AccessibleThrough(Verb.Post)]
		public void Reset(bool confirm)
		{
			if( confirm )
			{
				ActiveRecordStarter.DropSchema();
				ActiveRecordStarter.CreateSchema();
				Directory.Delete(Context.Server.MapPath("~/App_Data/Resonator_FT"), true);
			}
			
			RedirectToAction( "index" ); 
		}
	}
}
